package com.cskaoyan.javase.oop1._13block._3static.classload;

/**
 * 读程序题
 * 类加载类初始化的过程中需要执行:
 *      所有和static相关的语句
 *      包括:
 *      静态成员变量的显式赋值
 *      静态代码块
 * @since 17:25
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class TestStaticDemo {
    public static void main(String[] args) {
        // staticMethod();
    }

    static TestStaticDemo ts = new TestStaticDemo();

    static {
        System.out.println("静态代码块");
    }

    {
        System.out.println("构造代码块");
    }

    public TestStaticDemo() {
        System.out.println("无参构造器");
        System.out.println("a=" + a + ",b=" + b);
    }

    public static void staticMethod() {
        System.out.println("静态成员方法");
        System.out.println(b);
    }

    int a = 666;
    static int b = 777;

    static TestStaticDemo ts2 = new TestStaticDemo();

}